package loader

import (
    "fmt"
    "github.com/spf13/viper"
)

func LoadConfig(env string) error {
    viper.SetConfigName(env)
    viper.AddConfigPath("../config/env")
    viper.SetConfigType("yaml")

    if err := viper.ReadInConfig(); err != nil {
        return fmt.Errorf("failed to read config file: %w", err)
    }

    return nil
}